package xiangmu.schoolpaper.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import xiangmu.schoolpaper.pojo.entity.User;

/**
* @author 86152
* @description 针对表【user(用户表)】的数据库操作Mapper
* @createDate 2025-08-20 22:28:16
* @Entity .controller.User
*/
public interface UserMapper extends BaseMapper<User> {
    // 根据账号查用户
    @Select("SELECT * FROM `user` WHERE account = #{account}")
    User getUserByAccount(@Param("account") String account);

    // 修改密码
    @Update("UPDATE user SET password = #{newPassword} WHERE account = #{account}")
    int updatePassword(@Param("account") String account, @Param("newPassword") String newPassword);

}




